(function(){
	Ext.onReady(function(){
		Ext.create('Ext.toolbar.Toolbar',{
			renderTo:Ext.getBody(),
			width:300,
			items:[
				{text:'New',id:'newBtn',iconCls:'newIcon'},
				{text:'Update',id:'updateBtn',iconCls:'updateIcon'},
				{text:'Save',id:'saveBtn',iconCls:'saveIcon'},
				{text:'Delete',id:'DeleteBtn',iconCls:'DeleteIcon',handler:function(){
					Ext.getCmp("newBtn").destroy();
				}}
			]
		});
		
		var newBtn = Ext.getCmp("newBtn");
		newBtn.on("click",function(){
			alert("new")
		});
		
		newBtn.addManagedListener(Ext.getCmp("updateBtn"),"click",function(){
			alert("update");
		});
		
		newBtn.addManagedListener(Ext.getCmp("saveBtn"),"click",function(){
			alert("Save");
		});
		
	});
})();